package com.allwees.bs.module.ops.rest;

import com.allwees.bs.module.core.annotation.PrintLog;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.allwees.bs.core.modelbase.vo.R;
import com.allwees.bs.module.core.rest.BoCrudApi;
import com.allwees.bs.module.ops.entity.PointActiveDef;
import com.allwees.bs.module.ops.req.PointActiveDefCrudReq;
import com.allwees.bs.module.ops.req.query.PointActiveDefQueryReq;
import com.allwees.bs.module.ops.service.PointActiveDefService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author mouhaining
 * @since 2020-05-19 14:08
 */
@PrintLog
@RestController
@RequestMapping("/backstage/api/point_active_def")
public class PointActiveDefApi extends BoCrudApi<PointActiveDef, PointActiveDefService> {

    @GetMapping("/page")
    public R update(Page<PointActiveDef> page, PointActiveDefQueryReq req) {
        IPage<PointActiveDef> page1 = boService.findPage(page, req);
        return R.ok(page1);
    }

    @PutMapping("/update")
    public R update(@RequestBody PointActiveDefCrudReq req) {
        boService.update(req);
        return R.ok();
    }

    @PostMapping("/save")
    public R page(@RequestBody PointActiveDefCrudReq req) {
        boService.save(req);
        return R.ok();
    }

}
